/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = '';
  
  checkConfig(config);
  @endpoint = getEndpoint('buss', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model ApplyRemovingPunishRequest {
  aliUid?: string(name='AliUid'),
  id?: string(name='Id'),
}

model ApplyRemovingPunishResponseBody = {
  code?: string(name='Code'),
  count?: int32(name='Count'),
  data?: string(name='Data'),
  message?: string(name='Message'),
  success?: boolean(name='Success'),
}

model ApplyRemovingPunishResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ApplyRemovingPunishResponseBody(name='body'),
}

/**
 * @summary 自助解锁(安全管控控制台)
 *
 * @param request ApplyRemovingPunishRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ApplyRemovingPunishResponse
 */
async function applyRemovingPunishWithOptions(request: ApplyRemovingPunishRequest, runtime: Util.RuntimeOptions): ApplyRemovingPunishResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aliUid)) {
    query['AliUid'] = request.aliUid;
  }
  if (!Util.isUnset(request.id)) {
    query['Id'] = request.id;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ApplyRemovingPunish',
    version = '2016-07-18',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 自助解锁(安全管控控制台)
 *
 * @param request ApplyRemovingPunishRequest
 * @return ApplyRemovingPunishResponse
 */
async function applyRemovingPunish(request: ApplyRemovingPunishRequest): ApplyRemovingPunishResponse {
  var runtime = new Util.RuntimeOptions{};
  return applyRemovingPunishWithOptions(request, runtime);
}

model BatchAddPunishListRequest {
  punishListRequests?: [ 
    {
      dataType?: string(name='DataType'),
      dataValue?: string(name='DataValue'),
      operator?: string(name='Operator'),
      reason?: string(name='Reason'),
      sourceCode?: string(name='SourceCode'),
      type?: string(name='Type'),
    }
  ](name='PunishListRequests', description='This parameter is required.'),
}

model BatchAddPunishListResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model BatchAddPunishListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BatchAddPunishListResponseBody(name='body'),
}

/**
 * @param request BatchAddPunishListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return BatchAddPunishListResponse
 */
async function batchAddPunishListWithOptions(request: BatchAddPunishListRequest, runtime: Util.RuntimeOptions): BatchAddPunishListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.punishListRequests)) {
    query['PunishListRequests'] = request.punishListRequests;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'BatchAddPunishList',
    version = '2016-07-18',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request BatchAddPunishListRequest
 * @return BatchAddPunishListResponse
 */
async function batchAddPunishList(request: BatchAddPunishListRequest): BatchAddPunishListResponse {
  var runtime = new Util.RuntimeOptions{};
  return batchAddPunishListWithOptions(request, runtime);
}

model BatchDelPunishListRequest {
  punishListRequests?: [ 
    {
      dataType?: string(name='DataType'),
      dataValue?: string(name='DataValue'),
      operator?: string(name='Operator'),
      reason?: string(name='Reason'),
      sourceCode?: string(name='SourceCode'),
      type?: string(name='Type'),
    }
  ](name='PunishListRequests', description='This parameter is required.'),
}

model BatchDelPunishListResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model BatchDelPunishListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BatchDelPunishListResponseBody(name='body'),
}

/**
 * @param request BatchDelPunishListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return BatchDelPunishListResponse
 */
async function batchDelPunishListWithOptions(request: BatchDelPunishListRequest, runtime: Util.RuntimeOptions): BatchDelPunishListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.punishListRequests)) {
    query['PunishListRequests'] = request.punishListRequests;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'BatchDelPunishList',
    version = '2016-07-18',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request BatchDelPunishListRequest
 * @return BatchDelPunishListResponse
 */
async function batchDelPunishList(request: BatchDelPunishListRequest): BatchDelPunishListResponse {
  var runtime = new Util.RuntimeOptions{};
  return batchDelPunishListWithOptions(request, runtime);
}

model DelPunishWhiteForIdcispRequest {
  punishListRequests?: [ 
    {
      dataType?: string(name='DataType'),
      dataValue?: string(name='DataValue'),
      operator?: string(name='Operator'),
      reason?: string(name='Reason'),
      sourceCode?: string(name='SourceCode'),
      type?: string(name='Type'),
    }
  ](name='PunishListRequests', description='This parameter is required.'),
}

model DelPunishWhiteForIdcispResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  success?: boolean(name='Success'),
}

model DelPunishWhiteForIdcispResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DelPunishWhiteForIdcispResponseBody(name='body'),
}

/**
 * @summary 删除idcisp的白名单
 *
 * @param request DelPunishWhiteForIdcispRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DelPunishWhiteForIdcispResponse
 */
async function delPunishWhiteForIdcispWithOptions(request: DelPunishWhiteForIdcispRequest, runtime: Util.RuntimeOptions): DelPunishWhiteForIdcispResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.punishListRequests)) {
    query['PunishListRequests'] = request.punishListRequests;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DelPunishWhiteForIdcisp',
    version = '2016-07-18',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除idcisp的白名单
 *
 * @param request DelPunishWhiteForIdcispRequest
 * @return DelPunishWhiteForIdcispResponse
 */
async function delPunishWhiteForIdcisp(request: DelPunishWhiteForIdcispRequest): DelPunishWhiteForIdcispResponse {
  var runtime = new Util.RuntimeOptions{};
  return delPunishWhiteForIdcispWithOptions(request, runtime);
}

model FindFullPunishWhiteListRequest {
  dataType?: string(name='DataType', description='This parameter is required.'),
  sourceCode?: string(name='SourceCode', description='This parameter is required.'),
}

model FindFullPunishWhiteListResponseBody = {
  code?: string(name='Code'),
  data?: string(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model FindFullPunishWhiteListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: FindFullPunishWhiteListResponseBody(name='body'),
}

/**
 * @param request FindFullPunishWhiteListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return FindFullPunishWhiteListResponse
 */
async function findFullPunishWhiteListWithOptions(request: FindFullPunishWhiteListRequest, runtime: Util.RuntimeOptions): FindFullPunishWhiteListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.dataType)) {
    query['DataType'] = request.dataType;
  }
  if (!Util.isUnset(request.sourceCode)) {
    query['SourceCode'] = request.sourceCode;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'FindFullPunishWhiteList',
    version = '2016-07-18',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request FindFullPunishWhiteListRequest
 * @return FindFullPunishWhiteListResponse
 */
async function findFullPunishWhiteList(request: FindFullPunishWhiteListRequest): FindFullPunishWhiteListResponse {
  var runtime = new Util.RuntimeOptions{};
  return findFullPunishWhiteListWithOptions(request, runtime);
}

model FindPunishRequestByExtIdRequest {
  punishRequestId?: string(name='PunishRequestId', description='This parameter is required.'),
  sourceCode?: string(name='SourceCode', description='This parameter is required.'),
}

model FindPunishRequestByExtIdResponseBody = {
  code?: string(name='Code'),
  data?: string(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model FindPunishRequestByExtIdResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: FindPunishRequestByExtIdResponseBody(name='body'),
}

/**
 * @param request FindPunishRequestByExtIdRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return FindPunishRequestByExtIdResponse
 */
async function findPunishRequestByExtIdWithOptions(request: FindPunishRequestByExtIdRequest, runtime: Util.RuntimeOptions): FindPunishRequestByExtIdResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.punishRequestId)) {
    query['PunishRequestId'] = request.punishRequestId;
  }
  if (!Util.isUnset(request.sourceCode)) {
    query['SourceCode'] = request.sourceCode;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'FindPunishRequestByExtId',
    version = '2016-07-18',
    protocol = 'HTTP',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request FindPunishRequestByExtIdRequest
 * @return FindPunishRequestByExtIdResponse
 */
async function findPunishRequestByExtId(request: FindPunishRequestByExtIdRequest): FindPunishRequestByExtIdResponse {
  var runtime = new Util.RuntimeOptions{};
  return findPunishRequestByExtIdWithOptions(request, runtime);
}

model FindPunishRequestByIdRequest {
  id?: long(name='Id', description='This parameter is required.'),
  userId?: string(name='UserId', description='This parameter is required.'),
}

model FindPunishRequestByIdResponseBody = {
  code?: string(name='Code'),
  data?: string(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model FindPunishRequestByIdResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: FindPunishRequestByIdResponseBody(name='body'),
}

/**
 * @param request FindPunishRequestByIdRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return FindPunishRequestByIdResponse
 */
async function findPunishRequestByIdWithOptions(request: FindPunishRequestByIdRequest, runtime: Util.RuntimeOptions): FindPunishRequestByIdResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.id)) {
    query['Id'] = request.id;
  }
  if (!Util.isUnset(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'FindPunishRequestById',
    version = '2016-07-18',
    protocol = 'HTTP',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request FindPunishRequestByIdRequest
 * @return FindPunishRequestByIdResponse
 */
async function findPunishRequestById(request: FindPunishRequestByIdRequest): FindPunishRequestByIdResponse {
  var runtime = new Util.RuntimeOptions{};
  return findPunishRequestByIdWithOptions(request, runtime);
}

model FindPunishWhiteRequest {
  dataType?: string(name='DataType', description='This parameter is required.'),
  dataValues?: [ string ](name='DataValues', description='This parameter is required.'),
  sourceCode?: string(name='SourceCode', description='This parameter is required.'),
}

model FindPunishWhiteResponseBody = {
  code?: string(name='Code'),
  data?: string(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model FindPunishWhiteResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: FindPunishWhiteResponseBody(name='body'),
}

/**
 * @param request FindPunishWhiteRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return FindPunishWhiteResponse
 */
async function findPunishWhiteWithOptions(request: FindPunishWhiteRequest, runtime: Util.RuntimeOptions): FindPunishWhiteResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.dataType)) {
    query['DataType'] = request.dataType;
  }
  if (!Util.isUnset(request.dataValues)) {
    query['DataValues'] = request.dataValues;
  }
  if (!Util.isUnset(request.sourceCode)) {
    query['SourceCode'] = request.sourceCode;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'FindPunishWhite',
    version = '2016-07-18',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request FindPunishWhiteRequest
 * @return FindPunishWhiteResponse
 */
async function findPunishWhite(request: FindPunishWhiteRequest): FindPunishWhiteResponse {
  var runtime = new Util.RuntimeOptions{};
  return findPunishWhiteWithOptions(request, runtime);
}

model PunishWhiteListServiceRequest {
  dataType?: string(name='DataType'),
  dataValues?: [ string ](name='DataValues'),
  filterGlobal?: boolean(name='FilterGlobal'),
  sourceCode?: string(name='SourceCode'),
}

model PunishWhiteListServiceShrinkRequest {
  dataType?: string(name='DataType'),
  dataValuesShrink?: string(name='DataValues'),
  filterGlobal?: boolean(name='FilterGlobal'),
  sourceCode?: string(name='SourceCode'),
}

model PunishWhiteListServiceResponseBody = {
  code?: string(name='code'),
  data?: map[string]string(name='data'),
  message?: string(name='message'),
  success?: boolean(name='success'),
}

model PunishWhiteListServiceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PunishWhiteListServiceResponseBody(name='body'),
}

/**
 * @summary 白名单服务
 *
 * @param tmpReq PunishWhiteListServiceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return PunishWhiteListServiceResponse
 */
async function punishWhiteListServiceWithOptions(tmpReq: PunishWhiteListServiceRequest, runtime: Util.RuntimeOptions): PunishWhiteListServiceResponse {
  Util.validateModel(tmpReq);
  var request = new PunishWhiteListServiceShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.dataValues)) {
    request.dataValuesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.dataValues, 'DataValues', 'json');
  }
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'PunishWhiteListService',
    version = '2016-07-18',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 白名单服务
 *
 * @param request PunishWhiteListServiceRequest
 * @return PunishWhiteListServiceResponse
 */
async function punishWhiteListService(request: PunishWhiteListServiceRequest): PunishWhiteListServiceResponse {
  var runtime = new Util.RuntimeOptions{};
  return punishWhiteListServiceWithOptions(request, runtime);
}

model QueryIppTaskListRequest {
  param0?: long(name='Param0'),
  param1?: long(name='Param1'),
}

model QueryIppTaskListResponseBody = {
  errorCode?: string(name='ErrorCode'),
  module?: string(name='Module'),
  success?: boolean(name='Success'),
  total?: long(name='Total'),
}

model QueryIppTaskListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryIppTaskListResponseBody(name='body'),
}

/**
 * @summary 验证 IPP 接口连通性
 *
 * @param request QueryIppTaskListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryIppTaskListResponse
 */
async function queryIppTaskListWithOptions(request: QueryIppTaskListRequest, runtime: Util.RuntimeOptions): QueryIppTaskListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.param0)) {
    query['Param0'] = request.param0;
  }
  if (!Util.isUnset(request.param1)) {
    query['Param1'] = request.param1;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryIppTaskList',
    version = '2016-07-18',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 验证 IPP 接口连通性
 *
 * @param request QueryIppTaskListRequest
 * @return QueryIppTaskListResponse
 */
async function queryIppTaskList(request: QueryIppTaskListRequest): QueryIppTaskListResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryIppTaskListWithOptions(request, runtime);
}

model QueryOverseaIppTaskListRequest {
  param0?: long(name='Param0'),
  param1?: long(name='Param1'),
}

model QueryOverseaIppTaskListResponseBody = {
  errorCode?: string(name='ErrorCode'),
  module?: string(name='Module'),
  success?: boolean(name='Success'),
  total?: long(name='Total'),
}

model QueryOverseaIppTaskListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryOverseaIppTaskListResponseBody(name='body'),
}

/**
 * @summary 验证 IPP 接口连通性
 *
 * @param request QueryOverseaIppTaskListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryOverseaIppTaskListResponse
 */
async function queryOverseaIppTaskListWithOptions(request: QueryOverseaIppTaskListRequest, runtime: Util.RuntimeOptions): QueryOverseaIppTaskListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.param0)) {
    query['Param0'] = request.param0;
  }
  if (!Util.isUnset(request.param1)) {
    query['Param1'] = request.param1;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryOverseaIppTaskList',
    version = '2016-07-18',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 验证 IPP 接口连通性
 *
 * @param request QueryOverseaIppTaskListRequest
 * @return QueryOverseaIppTaskListResponse
 */
async function queryOverseaIppTaskList(request: QueryOverseaIppTaskListRequest): QueryOverseaIppTaskListResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryOverseaIppTaskListWithOptions(request, runtime);
}

model QueryPunishForRcRequest {
  aliUid?: string(name='AliUid', description='This parameter is required.'),
  currentPage?: int32(name='CurrentPage'),
  dateEnd?: long(name='DateEnd'),
  dateStart?: long(name='DateStart'),
  pageSize?: int32(name='PageSize'),
}

model QueryPunishForRcResponseBody = {
  code?: string(name='Code'),
  data?: {
    punishRequestDTO?: [ 
    {
      antiResult?: string(name='AntiResult'),
      antiStatus?: string(name='AntiStatus'),
      bussinessCode?: string(name='BussinessCode'),
      eventCode?: string(name='EventCode'),
      extRequestId?: string(name='ExtRequestId'),
      gmtCreated?: long(name='GmtCreated'),
      id?: long(name='Id'),
      instanceId?: string(name='InstanceId'),
      punishDomain?: string(name='PunishDomain'),
      punishIp?: string(name='PunishIp'),
      punishResult?: string(name='PunishResult'),
      punishStatus?: string(name='PunishStatus'),
      punishUrl?: string(name='PunishUrl'),
      reason?: string(name='Reason'),
      sourceCode?: string(name='SourceCode'),
      userId?: string(name='UserId'),
    }
  ](name='PunishRequestDTO')
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  total?: int32(name='Total'),
}

model QueryPunishForRcResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryPunishForRcResponseBody(name='body'),
}

/**
 * @param request QueryPunishForRcRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryPunishForRcResponse
 */
async function queryPunishForRcWithOptions(request: QueryPunishForRcRequest, runtime: Util.RuntimeOptions): QueryPunishForRcResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aliUid)) {
    query['AliUid'] = request.aliUid;
  }
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.dateEnd)) {
    query['DateEnd'] = request.dateEnd;
  }
  if (!Util.isUnset(request.dateStart)) {
    query['DateStart'] = request.dateStart;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryPunishForRc',
    version = '2016-07-18',
    protocol = 'HTTP',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request QueryPunishForRcRequest
 * @return QueryPunishForRcResponse
 */
async function queryPunishForRc(request: QueryPunishForRcRequest): QueryPunishForRcResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryPunishForRcWithOptions(request, runtime);
}

model QueryPunishListRequest {
  currentPage?: int32(name='CurrentPage'),
  dateEnd?: long(name='DateEnd'),
  dateStart?: long(name='DateStart'),
  pageSize?: int32(name='PageSize'),
  punishIp?: string(name='PunishIp'),
  punishUrl?: string(name='PunishUrl'),
}

model QueryPunishListResponseBody = {
  code?: string(name='Code'),
  data?: string(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model QueryPunishListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryPunishListResponseBody(name='body'),
}

/**
 * @param request QueryPunishListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryPunishListResponse
 */
async function queryPunishListWithOptions(request: QueryPunishListRequest, runtime: Util.RuntimeOptions): QueryPunishListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.dateEnd)) {
    query['DateEnd'] = request.dateEnd;
  }
  if (!Util.isUnset(request.dateStart)) {
    query['DateStart'] = request.dateStart;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.punishIp)) {
    query['PunishIp'] = request.punishIp;
  }
  if (!Util.isUnset(request.punishUrl)) {
    query['PunishUrl'] = request.punishUrl;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryPunishList',
    version = '2016-07-18',
    protocol = 'HTTP',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request QueryPunishListRequest
 * @return QueryPunishListResponse
 */
async function queryPunishList(request: QueryPunishListRequest): QueryPunishListResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryPunishListWithOptions(request, runtime);
}

model QueryRiskPunishListRequest {
  aliUid?: string(name='AliUid'),
  currentPage?: int32(name='CurrentPage'),
  dateEnd?: string(name='DateEnd'),
  dateStart?: string(name='DateStart'),
  ip?: string(name='Ip'),
  pageSize?: int32(name='PageSize'),
  url?: string(name='Url'),
}

model QueryRiskPunishListResponseBody = {
  code?: string(name='Code'),
  data?: {
    list?: [ 
      {
        action?: string(name='Action'),
        applyRecords?: [ 
          {
            applyStatus?: string(name='applyStatus'),
            failReason?: string(name='failReason'),
            gmtApply?: string(name='gmtApply'),
            gmtRemovePunish?: string(name='gmtRemovePunish'),
          }
        ](name='ApplyRecords'),
        applyStatus?: string(name='ApplyStatus'),
        business?: string(name='Business'),
        domain?: string(name='Domain'),
        gmtPunished?: string(name='GmtPunished'),
        id?: long(name='Id'),
        ip?: string(name='Ip'),
        isConfigWaf?: long(name='IsConfigWaf'),
        isDomain?: long(name='IsDomain'),
        port?: string(name='Port'),
        punishStatus?: string(name='PunishStatus'),
        reason?: string(name='Reason'),
        url?: string(name='Url'),
      }
    ](name='List'),
    pageInfo?: {
      currentPage?: long(name='CurrentPage'),
      pageSize?: long(name='PageSize'),
      total?: long(name='Total'),
    }(name='PageInfo'),
  }(name='Data'),
  message?: string(name='Message'),
  success?: boolean(name='Success'),
}

model QueryRiskPunishListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryRiskPunishListResponseBody(name='body'),
}

/**
 * @summary 查询处罚记录（安全管控控制台)
 *
 * @param request QueryRiskPunishListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryRiskPunishListResponse
 */
async function queryRiskPunishListWithOptions(request: QueryRiskPunishListRequest, runtime: Util.RuntimeOptions): QueryRiskPunishListResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryRiskPunishList',
    version = '2016-07-18',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询处罚记录（安全管控控制台)
 *
 * @param request QueryRiskPunishListRequest
 * @return QueryRiskPunishListResponse
 */
async function queryRiskPunishList(request: QueryRiskPunishListRequest): QueryRiskPunishListResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryRiskPunishListWithOptions(request, runtime);
}

model QueryRiskPunishRecordRequest {
  aliUid?: string(name='AliUid'),
  business?: string(name='Business'),
  currentPage?: long(name='CurrentPage'),
  ip?: string(name='Ip'),
  pageSize?: long(name='PageSize'),
  punishDateEnd?: string(name='PunishDateEnd'),
  punishDateStart?: string(name='PunishDateStart'),
  punishStatus?: string(name='PunishStatus'),
  url?: string(name='Url'),
  yundunAccessKey?: string(name='YundunAccessKey'),
  yundunAccessKeySecret?: string(name='YundunAccessKeySecret'),
}

model QueryRiskPunishRecordResponseBody = {
  code?: string(name='Code'),
  data?: {
    list?: [ 
      {
        action?: string(name='Action'),
        applyRecords?: [ 
          {
            applyStatus?: string(name='applyStatus'),
            failReason?: string(name='failReason'),
            gmtApply?: string(name='gmtApply'),
            gmtRemovePunish?: string(name='gmtRemovePunish'),
          }
        ](name='ApplyRecords'),
        applyStatus?: string(name='ApplyStatus'),
        business?: string(name='Business'),
        domain?: string(name='Domain'),
        gmtPunished?: string(name='GmtPunished'),
        id?: long(name='Id'),
        ip?: string(name='Ip'),
        isConfigWaf?: long(name='IsConfigWaf'),
        isDomain?: long(name='IsDomain'),
        port?: string(name='Port'),
        punishStatus?: string(name='PunishStatus'),
        reason?: string(name='Reason'),
        url?: string(name='Url'),
      }
    ](name='List'),
    pageInfo?: {
      currentPage?: long(name='CurrentPage'),
      pageSize?: long(name='PageSize'),
      total?: long(name='Total'),
    }(name='PageInfo'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model QueryRiskPunishRecordResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryRiskPunishRecordResponseBody(name='body'),
}

/**
 * @summary 查询处罚记录(安全管控控制台)
 *
 * @param request QueryRiskPunishRecordRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryRiskPunishRecordResponse
 */
async function queryRiskPunishRecordWithOptions(request: QueryRiskPunishRecordRequest, runtime: Util.RuntimeOptions): QueryRiskPunishRecordResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryRiskPunishRecord',
    version = '2016-07-18',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询处罚记录(安全管控控制台)
 *
 * @param request QueryRiskPunishRecordRequest
 * @return QueryRiskPunishRecordResponse
 */
async function queryRiskPunishRecord(request: QueryRiskPunishRecordRequest): QueryRiskPunishRecordResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryRiskPunishRecordWithOptions(request, runtime);
}

model ReceiveRaiderDataRequest {
  raiderData?: map[string]any(name='RaiderData', description='This parameter is required.'),
}

model ReceiveRaiderDataShrinkRequest {
  raiderDataShrink?: string(name='RaiderData', description='This parameter is required.'),
}

model ReceiveRaiderDataResponseBody = {
  code?: string(name='Code'),
  data?: string(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ReceiveRaiderDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ReceiveRaiderDataResponseBody(name='body'),
}

/**
 * @param tmpReq ReceiveRaiderDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ReceiveRaiderDataResponse
 */
async function receiveRaiderDataWithOptions(tmpReq: ReceiveRaiderDataRequest, runtime: Util.RuntimeOptions): ReceiveRaiderDataResponse {
  Util.validateModel(tmpReq);
  var request = new ReceiveRaiderDataShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.raiderData)) {
    request.raiderDataShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.raiderData, 'RaiderData', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.raiderDataShrink)) {
    body['RaiderData'] = request.raiderDataShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ReceiveRaiderData',
    version = '2016-07-18',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request ReceiveRaiderDataRequest
 * @return ReceiveRaiderDataResponse
 */
async function receiveRaiderData(request: ReceiveRaiderDataRequest): ReceiveRaiderDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return receiveRaiderDataWithOptions(request, runtime);
}

model RiskPunishRequest {
  bussinessCode?: string(name='BussinessCode', description='This parameter is required.'),
  domain?: string(name='Domain'),
  eventCode?: string(name='EventCode', description='This parameter is required.'),
  expectedRemoveTime?: long(name='ExpectedRemoveTime'),
  extras?: map[string]any(name='Extras'),
  filterSpecialAccount?: boolean(name='FilterSpecialAccount'),
  filterWhite?: boolean(name='FilterWhite'),
  instanceId?: string(name='InstanceId'),
  ip?: string(name='Ip'),
  isDirectPunish?: boolean(name='IsDirectPunish'),
  punishDate?: long(name='PunishDate'),
  punishRequestId?: string(name='PunishRequestId', description='This parameter is required.'),
  punishUrl?: string(name='PunishUrl'),
  reason?: string(name='Reason', description='This parameter is required.'),
  sourceCode?: string(name='SourceCode', description='This parameter is required.'),
  userId?: string(name='UserId'),
}

model RiskPunishShrinkRequest {
  bussinessCode?: string(name='BussinessCode', description='This parameter is required.'),
  domain?: string(name='Domain'),
  eventCode?: string(name='EventCode', description='This parameter is required.'),
  expectedRemoveTime?: long(name='ExpectedRemoveTime'),
  extrasShrink?: string(name='Extras'),
  filterSpecialAccount?: boolean(name='FilterSpecialAccount'),
  filterWhite?: boolean(name='FilterWhite'),
  instanceId?: string(name='InstanceId'),
  ip?: string(name='Ip'),
  isDirectPunish?: boolean(name='IsDirectPunish'),
  punishDate?: long(name='PunishDate'),
  punishRequestId?: string(name='PunishRequestId', description='This parameter is required.'),
  punishUrl?: string(name='PunishUrl'),
  reason?: string(name='Reason', description='This parameter is required.'),
  sourceCode?: string(name='SourceCode', description='This parameter is required.'),
  userId?: string(name='UserId'),
}

model RiskPunishResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model RiskPunishResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RiskPunishResponseBody(name='body'),
}

/**
 * @param tmpReq RiskPunishRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RiskPunishResponse
 */
async function riskPunishWithOptions(tmpReq: RiskPunishRequest, runtime: Util.RuntimeOptions): RiskPunishResponse {
  Util.validateModel(tmpReq);
  var request = new RiskPunishShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.extras)) {
    request.extrasShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.extras, 'Extras', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.bussinessCode)) {
    query['BussinessCode'] = request.bussinessCode;
  }
  if (!Util.isUnset(request.domain)) {
    query['Domain'] = request.domain;
  }
  if (!Util.isUnset(request.eventCode)) {
    query['EventCode'] = request.eventCode;
  }
  if (!Util.isUnset(request.expectedRemoveTime)) {
    query['ExpectedRemoveTime'] = request.expectedRemoveTime;
  }
  if (!Util.isUnset(request.extrasShrink)) {
    query['Extras'] = request.extrasShrink;
  }
  if (!Util.isUnset(request.filterSpecialAccount)) {
    query['FilterSpecialAccount'] = request.filterSpecialAccount;
  }
  if (!Util.isUnset(request.filterWhite)) {
    query['FilterWhite'] = request.filterWhite;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.ip)) {
    query['Ip'] = request.ip;
  }
  if (!Util.isUnset(request.isDirectPunish)) {
    query['IsDirectPunish'] = request.isDirectPunish;
  }
  if (!Util.isUnset(request.punishDate)) {
    query['PunishDate'] = request.punishDate;
  }
  if (!Util.isUnset(request.punishRequestId)) {
    query['PunishRequestId'] = request.punishRequestId;
  }
  if (!Util.isUnset(request.punishUrl)) {
    query['PunishUrl'] = request.punishUrl;
  }
  if (!Util.isUnset(request.reason)) {
    query['Reason'] = request.reason;
  }
  if (!Util.isUnset(request.sourceCode)) {
    query['SourceCode'] = request.sourceCode;
  }
  if (!Util.isUnset(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RiskPunish',
    version = '2016-07-18',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request RiskPunishRequest
 * @return RiskPunishResponse
 */
async function riskPunish(request: RiskPunishRequest): RiskPunishResponse {
  var runtime = new Util.RuntimeOptions{};
  return riskPunishWithOptions(request, runtime);
}

model RiskPunishRemoveRequest {
  extras?: map[string]any(name='Extras'),
  punishRequestId?: string(name='PunishRequestId', description='This parameter is required.'),
  rmPunish?: boolean(name='RmPunish'),
  sourceCode?: string(name='SourceCode', description='This parameter is required.'),
}

model RiskPunishRemoveShrinkRequest {
  extrasShrink?: string(name='Extras'),
  punishRequestId?: string(name='PunishRequestId', description='This parameter is required.'),
  rmPunish?: boolean(name='RmPunish'),
  sourceCode?: string(name='SourceCode', description='This parameter is required.'),
}

model RiskPunishRemoveResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model RiskPunishRemoveResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RiskPunishRemoveResponseBody(name='body'),
}

/**
 * @param tmpReq RiskPunishRemoveRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RiskPunishRemoveResponse
 */
async function riskPunishRemoveWithOptions(tmpReq: RiskPunishRemoveRequest, runtime: Util.RuntimeOptions): RiskPunishRemoveResponse {
  Util.validateModel(tmpReq);
  var request = new RiskPunishRemoveShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.extras)) {
    request.extrasShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.extras, 'Extras', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.extrasShrink)) {
    query['Extras'] = request.extrasShrink;
  }
  if (!Util.isUnset(request.punishRequestId)) {
    query['PunishRequestId'] = request.punishRequestId;
  }
  if (!Util.isUnset(request.rmPunish)) {
    query['RmPunish'] = request.rmPunish;
  }
  if (!Util.isUnset(request.sourceCode)) {
    query['SourceCode'] = request.sourceCode;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RiskPunishRemove',
    version = '2016-07-18',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request RiskPunishRemoveRequest
 * @return RiskPunishRemoveResponse
 */
async function riskPunishRemove(request: RiskPunishRemoveRequest): RiskPunishRemoveResponse {
  var runtime = new Util.RuntimeOptions{};
  return riskPunishRemoveWithOptions(request, runtime);
}

